package com.schooleducation.service.impl;

import com.schooleducation.dao.DaoFactory;

public class SuperService {

	private DaoFactory daoFac;

	public DaoFactory getDaoFac() {
		return daoFac;
	}

	public void setDaoFac(DaoFactory daoFac) {
		this.daoFac = daoFac;
	}

	/**
	 * 数据页数计算
	 * 
	 * @param count
	 *            数据总条数
	 * @param limit
	 *            每一页数据条数
	 * @return
	 */
	public int getPageCount(int count, int limit) {
		int page = 1;
		if (count > limit) {
			if (count % limit == 0) {
				page = count / limit;
			} else {
				page = count / limit + 1;
			}
		}
		return page;
	}

}
